package com.xo.xodemo.mapper.db1;


import com.xo.xodemo.model.BaseUser;
import com.xo.xodemo.model.ReturnUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    BaseUser loadUserByUsername(@Param(value = "username") String name);
    BaseUser  selectByemployeeNumber(@Param(value = "employeeNumber") String employeeNumber);
    int insertuser(@Param(value = "baseUser")BaseUser baseUser);
    Integer selectPositionByName(@Param(value = "username") String name);
    Integer updateUser(@Param(value = "username") String name,@Param(value = "password") String password,@Param(value = "positionId") String positionId);
    List<ReturnUser> selectAll();
    List<ReturnUser> selectAllByName(@Param(value = "username") String username);
    List<ReturnUser>selectReviseData(@Param(value = "username") String username);
    List<String> findproofbargainfirstauditinguser();
     List<BaseUser>  findBypositionId(@Param(value = "positionId") String positionId);
    List<BaseUser>  findByUserName(@Param(value = "userName") String userName);
    int  deleteUser(@Param(value = "userId") String userId);
    Integer updateBySelf(@Param(value = "username") String name,@Param(value = "password") String password,@Param(value = "realName") String realName);
    ReturnUser findPositonDepartmentNameByName(@Param(value = "username") String name);
    ReturnUser  findDepartmentByName(@Param(value = "realName") String realName);
    String  selectName(@Param(value = "username") String username);
    int  updateRealName(@Param(value = "realName") String realName,@Param(value = "username") String username);
    int  updatePassword(@Param(value = "password") String password,@Param(value = "username") String username);
//    根据用户id修改除了用户密码外的信息
    int updateUserExceptPassword(@Param(value="realName") String realName,@Param(value="positionId") Integer positionId,
                                 @Param(value="departmentId") Integer departmentId,@Param(value="employeeNumber") String employeeNumber,
                                 @Param(value="userId") String userId,@Param(value="isIncumbency") Integer isIncumbency);
//    根据用户名修改用户的在职状态
    int updateIsIncumbencyByUserName(@Param(value = "username") String username,@Param(value = "isIncumbency") Integer isIncumbency);
//    根据用户名查找用户的在职状态
    Integer selectIsIncumbencyByUserName(@Param(value = "username") String username);
}
